﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace House_Control
{
    //This class will deal with everything regarding Ovens in the House.
    class Oven : Appliance
    {
        //We need this variable for when we call the base class constructor.
        static int applianceType = Appliance.OVEN;

        //These two variables keep track of the current temperature of the oven, and the temperature we want to be at.
        double currentTemp;
        double targetTemp;

        //This variable tells us if the light is on or not.
        bool isLightOn;

        //In C#, you use : base() to call the constructor of the base class and in this case the constructor takes applianceType as an argument.
        public Oven() : base(applianceType)
        {
            currentTemp = 75.6;
            targetTemp = 100;
            isLightOn = false;
        }

        public void setTargetTemp(double temp)
        {
            targetTemp = temp;
        }

        public double getCurrentTemp()
        {
            return currentTemp;
        }

        public double getTargetTemp()
        {
            return targetTemp;
        }

        //This method deals with turning the light on / off.
        public void changeLightState()
        {
            if (isLightOn) isLightOn = false;
            else isLightOn = true;
        }

        public string getLightStateString()
        {
            if (isLightOn) return "On";
            else return "Off";
        }
    }
}
